package com.zxy;

import java.util.Iterator;
import java.util.LinkedHashSet;

public class LinkedHashSetDemo {

    public static void main(String[] args) {

        LinkedHashSet<String> set = new LinkedHashSet();
        set.add("zhangsan");
        set.add("list");
        set.add("wangwu");
        set.add("zhoaliu");

        Iterator<String> iterator = set.iterator();
        while (iterator.hasNext()) {
            String next = iterator.next();
            System.out.println(next);

        }

    }
}
